#define SEG_PL(segsel) ((segsel) & 0x3)
#define _MC_MSRINJ_F_REQ_HWCR_WREN (1 << 16)
-#if 1 /* XXFM switch to 0 for putback */
-
-#define x86_mcerr(str, err) _x86_mcerr(str, err)
-
-static int _x86_mcerr(const char *msg, int err)
+#if 0
+static int x86_mcerr(const char *msg, int err)
{
- printk("x86_mcerr: %s, returning %d\n",
- msg != NULL ? msg : "", err);
- return err;
+ gdprintk(XENLOG_WARNING, "x86_mcerr: %s, returning %d\n",
+ msg != NULL ? msg : "", err);
+ return err;
}
#else
-#define x86_mcerr(str,err)
+#define x86_mcerr(msg, err) (err)
#endif
cpu_banks_t mca_allbanks;
struct xen_mc_msrinject *mc_msrinject;
struct xen_mc_mceinject *mc_mceinject;
+ if (!IS_PRIV(v->domain) )
+ return x86_mcerr(NULL, -EPERM);
+
if ( copy_from_guest(op, u_xen_mc, 1) )
return x86_mcerr("do_mca: failed copyin of xen_mc_t", -EFAULT);
mc_fetch.nat = &op->u.mc_fetch;
cmdflags = mc_fetch.nat->flags;
- /* This hypercall is for Dom0 only */
- if (!IS_PRIV(v->domain) )
- return x86_mcerr(NULL, -EPERM);
-
switch (cmdflags & (XEN_MC_NONURGENT | XEN_MC_URGENT)) {
case XEN_MC_NONURGENT:
which = MC_NONURGENT;
return x86_mcerr("do_mca notify unsupported", -EINVAL);
case XEN_MC_physcpuinfo:
- if ( !IS_PRIV(v->domain) )
- return x86_mcerr("do_mca cpuinfo", -EPERM);
-
mc_physcpuinfo.nat = &op->u.mc_physcpuinfo;
nlcpu = num_online_cpus();
break;
case XEN_MC_msrinject:
- if ( !IS_PRIV(v->domain) )
- return x86_mcerr("do_mca inject", -EPERM);
-
if (nr_mce_banks == 0)
return x86_mcerr("do_mca inject", -ENODEV);
break;
case XEN_MC_mceinject:
- if ( !IS_PRIV(v->domain) )
- return x86_mcerr("do_mca #MC", -EPERM);
-
if (nr_mce_banks == 0)
return x86_mcerr("do_mca #MC", -ENODEV);